"use strict";
const Constant = require("../basics/constant");
const BaseModel = require("../basics/mysql/mapper");

class HomeModel extends BaseModel {

  constructor(cloud) {
    super(cloud, "nk_jumps");
  }

  /**
   * 获取实例
   * @param {*} cloud 
   */
  static getInstant(cloud) {
    return new HomeModel(cloud);
  }

  /**
   * 查询单条
   * @param {string} code 
   */
  async selectOne(code) {
    const ex = this.createExample();
    ex.criteria.andEqual("code", code).andEqual("isuse", Constant.YesOrNo.yes);
    return await this.selectOneByExample(ex);
  }
}
module.exports = HomeModel;